import json
import glob
import numpy as np

files = sorted(glob.glob("offline_data/2s3z/good/*.json"))
print(f"Found {len(files)} files.")

with open(files[0], "r") as f:
    data = json.load(f)

global_dim = len(data[0][0][0])     # global state
local_dim = len(data[0][0][1])      # local obs
action_dim = len(data[0][0][5])     # available actions → 推断动作维度

print(f"Detected:")
print(f"  Global state dim: {global_dim}")
print(f"  Local obs dim   : {local_dim}")
print(f"  Action dim      : {action_dim}")
